package com.chen.solution.rpc.commonlib.auth;

/**
 * @author ChenTian
 * @date 2022/4/10
 */
public class AuthConstant {

    /**
     * AUTHORIZATION_HEADER is the http request header
     * key used for accessing the internal authorization.
     */
    public static final String AUTHORIZATION_HEADER = "Authorization";

    /**
     * header set for internal user id
     */
    public static final String CURRENT_USER_HEADER = "gateway-current-user-id";

    /**
     * AUTHORIZATION_AUTHENTICATED_USER is set as the Authorization header to denote that
     * a request is being made by an authenticated web user
     */
    public static final String AUTHORIZATION_AUTHENTICATED_USER = "gateway-authenticated";

    /**
     * AUTHORIZATION_COMPANY_SERVICE is set as the Authorization header to denote
     * that a request is being made by the demo web service
     */
    public static final String AUTHORIZATION_DEMO_WEB_SERVICE = "demo-web-service";

    /**
     * AUTHORIZATION_SUPPORT_USER is set as the Authorization header to denote that
     * a request is being made by a team member (可用于单元测试时权限认证身份信息)
     */
    public static final String AUTHORIZATION_SUPPORT_USER = "gateway-support";

    /**
     * AUTHORIZATION_SUPERPOWERS_SERVICE is set as the Authorization header to
     * denote that a request is being made by the dev-only superpowers service
     */
    public static final String AUTHORIZATION_SUPERPOWERS_SERVICE = "superpowers-service";

    /**
     * AUTH ERROR Messages
     */
    public static final String ERROR_MSG_MISSING_AUTH_HEADER = "Missing Authorization http header";
    public static final String ERROR_MSG_DO_NOT_HAVE_ACCESS = "You do not have access to this service";
}
